//
//  YYMusicFindMusicTableViewCell.swift
//  STMusic
//
//  Created by stoneobs on 2017/6/14.
//  Copyright © 2017年 stoneobs. All rights reserved.
// //**********************猎乐***************************

import UIKit

class YYMusicFindMusicTableViewCell: UITableViewCell {
    
    static var cellHeight:CGFloat = 105;
    
    var indexLable:STLabel?
    
    var titleLable:STLabel?
    
    var desLable:STLabel?
    
    var model:YYFindMusicModel = YYFindMusicModel(){
        
        didSet{
            
            self.indexLable?.text = model.mnum;
            
            self.titleLable?.text = model.mname;
            
            self.desLable?.text = model.mdesc;
            
            
            
            
        }
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier);
        self.initSubview();
        self.backgroundColor = UIColor.white.withAlphaComponent(0.7);
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func initSubview() {
        self.indexLable = STLabel.init(frame: .init(x: 35, y: 0, width: 25, height: 13),
                                       text: "1",
                                       textColor: ThirdTextColor,
                                       font: 13,
                                       isSizetoFit: false,
                                       textAlignment: .left);
        self.indexLable?.centerY = CGFloat(YYMusicArticleTableViewCell.cellHeight/2);
        self.addSubview(self.indexLable!);
        
        self.titleLable = STLabel.init(frame: .init(x: 15 + (self.indexLable?.right)!, y: 25, width: SCREEN_WIDTH - 50 - 20, height: 13),
                                       text: "房东的猫：把美好事物走完",
                                       textColor: FirstTextColor,
                                       font: 15,
                                       isSizetoFit: false,
                                       textAlignment: .left);
        self.addSubview(self.titleLable!);

        self.desLable = STLabel.init(frame: .init(x: 15 + (self.indexLable?.right)!, y: (self.titleLable?.bottom)! + 15, width: SCREEN_WIDTH - 50 - 20, height: 13),
                                       text: "房东的猫：把美好事物走完",
                                       textColor: ThirdTextColor,
                                       font: 13,
                                       isSizetoFit: false,
                                       textAlignment: .left);
        self.desLable?.lineBreakMode = .byClipping;
        self.addSubview(self.desLable!);
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
